<template>
  <div class="table-page-search-wrapper">
    <a-card>
      <a-form layout="inline">
        <a-row :gutter="48">
          <a-col :md="12" :sm="24">
            <span class="table-page-search-submitButtons" style=" overflow: hidden; margin:10px 20px">
              <a-button type="primary" @click="getStatis">刷新</a-button>
              <a-button type="primary" @click="exportExcel" style="margin-left:20px">导出</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </a-card>
    <a-card :bordered="false" style="margin-top: 10px">
      <a-alert :message="'总条数：' + list.length" type="info" show-icon />
      <a-table
        ref="table"
        size="default"
        rowKey="key"
        :columns="columns"
        :loading="loading"
        :dataSource="list"
        :pagination="false"
      >
        <span slot="serial" slot-scope="text, record, index">
          {{ index + 1 }}
        </span>
      </a-table>
    </a-card>
  </div>
</template>

<script>
export default {
  data () {
    return {
      loading: true,
      columns: [
        {
          title: '序号',
          scopedSlots: { customRender: 'serial' },
          width: 80
        },
        {
          title: '院系名称',
          dataIndex: 'yxmc'
        },
        {
          title: '科学学位硕士人数',
          dataIndex: 'kxxwssrs',
          width: '8%'
        },
        {
          title: '专业学位硕士人数',
          dataIndex: 'zyxwssrs',
          width: '8%'
        },
        {
          title: '硕导人数',
          dataIndex: 'sdrs',
          width: '8%'
        },
        {
          title: '兼职硕导',
          dataIndex: 'jzrs',
          width: '8%'
        },
        {
          title: '联合培养硕导',
          dataIndex: 'lhpysd',
          width: '8%'
        },
        {
          title: '科学学位博士生人数',
          dataIndex: 'kxxwbssrs',
          width: '10%'
        },
        {
          title: '专业学位博士生人数',
          dataIndex: 'zyxwbssrs',
          width: '10%'
        },
        {
          title: '博导人数',
          dataIndex: 'bdrs',
          width: '8%'
        },
        {
          title: '兼职博导',
          dataIndex: 'jzbd',
          width: '8%'
        }
      ],
      list: []
      // loadData: parameter => {
      //   // parameter.pageNum = parameter.pageNo
      //   return this.$api.teacher.teacherStatis().then(res => {
      //     return {
      //       data: res.data,
      //       pageNo: parameter.pageNo,
      //       pageSize: parameter.pageSize,
      //       totalPage: 1,
      //       totalCount: 1
      //     }
      //   })
      // }
    }
  },
  created () {
    this.getStatis()
  },
  methods: {
    getStatis () {
      this.$api.teacher.teacherStatis().then(res => {
        this.list = res.data
      }).finally(() => {
        this.loading = false
      })
    },
    exportExcel () {
      this.$export('/teacher/dsxx/exportdstj', {
        ...this.queryParam
      })
    }
  }
}
</script>

<style>

</style>
